﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Threading;

namespace CjcPhotoPrint
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
		private void Application_Startup( object sender, StartupEventArgs e )
		{
			Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

			MainWindow mainWindow = new MainWindow();

			mainWindow.Loaded += delegate
			{
				mainWindow.AddImages( e.Args );
			};

			mainWindow.Show();
		}

		void Current_DispatcherUnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e )
		{
			MessageBox.Show( e.Exception.Message, "Unhandled error", MessageBoxButton.OK, MessageBoxImage.Error );
		}
	}
}